package mc.support.taobao.api;

import com.taobao.api.TaobaoRequest;
import com.taobao.api.request.FuwuSaleLinkGenRequest;
import com.taobao.api.response.FuwuSaleLinkGenResponse;

/**
 * 该类用于生成淘宝服务平台营销链接所需请求
 * @author Vicotr Li lncwwn@gmail.com
 * @date 2014/09/23
 */
public class GenerateSaleLinkReq extends AbstractReq<GenerateSaleLinkReq, FuwuSaleLinkGenResponse> {

    // 优惠链接的指定生成用户
    private String nick;

    // 生成营销链接必传参数
    // 直接复制于服务商后台营销链接功能中生成的参数串
    private String paramStr;

    public GenerateSaleLinkReq setNick(String nick) {
        this.nick = nick;
        return this;
    }

    public GenerateSaleLinkReq setParamStr(String paramStr) {
        this.paramStr = paramStr;
        return this;
    }

    @Override
    protected TaobaoRequest toRequest() {
        FuwuSaleLinkGenRequest request = new FuwuSaleLinkGenRequest();
        if (null != nick) {
            request.setNick(nick);
        }
        if (null != paramStr) {
            request.setParamStr(paramStr);
        }
        return request;
    }
}
